import { useState, createRef, useRef, Component } from "react";

function App05() {
	const cref = createRef();
	const uref = useRef();
	const onClick = () => {
		console.log("cref:", cref, cref.current.value);
		console.log("uref:", uref, uref.current.value);
	};

	return (
		<div className="App">
			<div>
				<h2>用于挂载dom时：两者表现一致</h2>
				<div>createRef和Ref的区别</div>
				createRef: <input ref={cref} />
				<br />
				useRef: <input ref={uref} />
				<button onClick={onClick}>请点击 查看console</button>
			</div>
		</div>
	);
}

export default App05;
